package org.testmyapp.entities;

public class RefundPartPk {

	public BillPositionPk billPosition;
	public Integer refundPartNr;

	public RefundPartPk() {

	}

	public RefundPartPk(BillPositionPk billPosition, Integer refundPartNr) {
		this.billPosition = billPosition;
		this.refundPartNr = refundPartNr;
	}

	@Override
	public boolean equals(Object other) {
		if (other == null) {
			return false;
		}
		if (!other.getClass().equals(this.getClass())) {
			return false;
		}
		RefundPartPk otherObject = (RefundPartPk) other;
		if (otherObject == this) {
			return true;
		}
		if (billPosition != null && otherObject.billPosition != null
				&& billPosition.equals(otherObject.billPosition)) {
			if (refundPartNr != null && otherObject.refundPartNr != null
					&& refundPartNr.equals(otherObject.refundPartNr)) {
				return true;
			}
		}
		return false;
	}

	@Override
	public int hashCode() {
		if (billPosition == null || refundPartNr == null) {
			return 0;
		} else {
			return billPosition.hashCode() ^ refundPartNr.hashCode();
		}
	}
}
